import { PageDTO, PageRetVO, RetVO } from '@/http/public.type.ts';
import service from '../../http';
import { AddCommentDTO, CommentTree, TalkList } from './talk.types.ts';

export function _pageTalkList(param: PageDTO): Promise<PageRetVO<TalkList[]>> {
  return service.post('/api/v1.0/talk/pageTalkList', param);
}

export function _talkDetail(id: string): Promise<RetVO<TalkList>> {
  return service.post('/api/v1.0/talk/detail', { id });
}

export function _addTalkComment(param: AddCommentDTO): Promise<RetVO<any>> {
  return service.post('/api/v1.0/comment/addTalkComment', param);
}

export function _talkCommentTree(param: string): Promise<RetVO<CommentTree[]>> {
  return service.post('/api/v1.0/comment/talkCommentTree', { id: param });
}
